
// document.write('<script type="text/javascript" charset="UTF-8" src="https://scripts.easyliao.com/js/easyliao.js"></script><script type="text/javascript" charset="UTF-8" src="https://scripts.easyliao.com/37059/103955.js"></script>');
// document.write('<link rel="icon" type="image/x-icon" href="http://oss.kongjie88.com/b79f1e1eb9d1483d2a40375ac1693349.png" />')
var http="/api/cindex/";
$(function(){
  $(".menu").click(function(){
    $('.wap').toggle();
    $(this).toggleClass('on')
  });
})


$.ajax({
        type: 'post',
        url: '/api/cindex/mobilepc',
        dataType: "json",
        // async: false,
        success: function(res) {
            if(res.code==200){
             var mobile=res.data.mobile
            $(".tctiptel .red1").html(mobile).attr("href","tel:"+mobile)
            $(".phone").html(mobile).attr("href","tel:"+mobile)
            $(".copyright").html(res.data.copyright)
           
            }
        }
});

function post(url, data = "") {
    return axios.post("/api/cindex/" + url, data).then(res => {
        if (res.status == 200) {
            var dats = res.data
            if (dats.code == 200) {
                return dats.data;
            } else {
                return alert(dats.msg);
            }
        } else {
          console.log("请求失败")
        }
      
    })
}
function formpost(url, data = "") {
    return axios.post("/namesublime/" + url, data).then(res => {
        if (res.status == 200) {
            var dats = res.data
            if (dats.code == 200) {
              return dats.data;
            } else {
                return alert(dats.msg);
            }
        } else {
          console.log("请求失败")
        }
      
    })
}
 function get(url,data=""){
 return axios.get("/api/cindex/"+url,data).then( res=>{
if(res.status==200){
    var dats=res.data
  if(dats.code==200){
      return  dats.data;
  }else{
    return alert(dats.msg);
  }
}else{
    showToast("请求失败");
}
  })
}
// 电话号码
function info(){
  const data = {
    tel:'4008230180',
    company:'北京智途教育科技有限公司'
  }
  
   $.ajax({
        type: 'post',
        url: '/api/cindex/mobilepc',
        dataType: "json",
        // async: false,
        success: function(res) {
             if(res.code==200){
            data.tel=res.data.mobile
            data.company=res.data.copyright
            }
        }
});
  return data
}
function path(){
  return {
    xqjy:'01xqjy.html',
    gsgl:'02gsgl.html',
    gyjqr:'03gyjqr.html',
    jjgl:'04jjgl.html',
    it:'05it.html',
    rjgc:'06rjgc.html',
    yyhl:'07yyhl.html',
    art:'08yszy.html',
    art:'09art.html',
    kjzy:'10kjzy.html',
  }
}
//获取参数    
function getId (key) {
    var url = window.location.search;
    var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
    var result = url.substr(1).match(reg);
    return result ? decodeURIComponent(result[2]) : null;
}
function regM(value){
  var reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
  return reg.test(value)
}
// 验证手机号
function rulePhone (rule, value, callback){
  if (!value) {
    return callback(new Error('手机号不能为空'));
  } else {
    var reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
    console.log(reg.test(value));
    if (reg.test(value)) {
      callback();
    } else {
      return callback(new Error('请输入正确的手机号'));
    }
  }
}


// function openyiret(){try{openJesongChatByGroup(37059,71951);return false;}catch(e){console.log("发生异常:" + e)}}
// //易聊
// $("html [href='javascript:;']").css({'cursor':'pointer'})
// $(document).on('click', ".common-banner", function (event) {openyiret()});
// $(document).on('click', "[href='javascript:;']", function (event) {openyiret()});
// $(document).on('click', "[href='#']", function (event) {openyiret()});
// $(document).on('click', "[href='']", function (event) {openyiret()});



